home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 27.zip / BS1 part 27 / OpusBDS1.adf / RexxScripts / Only.rexx < prev    next >
OS/2 REXX Batch file  |  1993-01-12  |  2KB  |  50 lines

  1. /* Directory Opus REXX Script                                            */
  2. /* Select files using a pattern                                          */
  3.  
  4. options results                            /* request result string from */
  5.                                            /* external host              */
  6.  
  7. address 'DOPUS.1'                          /* set current host address   */
  8.                                            /* to directory opus          */
  9.  
  10. toptext "Select Files by Pattern"
  11.  
  12. result = ''
  13. pattern = ''
  14.  
  15. getstring 'Enter pattern...'               /* request selection pattern  */ 
  16.                                            /* see page 2-5 and 2-6 for   */
  17.                                            /* pattern matching rules     */
  18.  
  19. Pattern = Result
  20.  
  21. If Pattern > ''  then
  22.    call selectpattern
  23. Else
  24.    toptext "Selection Aborted"
  25.  
  26. Exit
  27.  
  28. selectpattern:
  29.    Pattern = '~(' || result || ')'         /* reverse selection logic    */ 
  30.    status 3                                /* determine current window   */   
  31.    window = result
  32.    rescan window                           /* rebuild window file list   */
  33.    none                                    /* deselect all files         */ 
  34.    address 'DOPUS.1' select pattern        /* select files               */
  35.    status 9 window                         /* count selected files       */
  36.    number_hide = result
  37.    if number_hide > 0 then
  38.       do i = 1 to number_hide
  39.          getnextselected                   /* get first file name        */
  40.          filename = result
  41.          filename = '"' || filename || '"'
  42.          address 'DOPUS.1' removefile filename 1
  43.                                            /* remove file from display   */                
  44.       End
  45.    status 6 window                         /* count number of entries    */
  46.    number_found = result
  47.    toptext 'Found' number_found 'file(s)'
  48. return
  49.  
  50.